package com.lyc.common.model;

import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 廖师兄
 * 2017-05-25 23:39
 */
@Data
@Entity
public class Category {

    @Id
    private Integer categoryId;

    private String categoryName;

    private Integer categoryLevel;

    private Integer categoryParentId;

    @Transient
    private List<Category> categoryList = new ArrayList<>();

    public void addCategory(Category category) {
        categoryList.add(category);
    }
}
